//
//  LocalEcho.m
//  DreamRoomage
//
//  Created by wjy on 15/9/23.
//  Copyright (c) 2015年 wjy. All rights reserved.
//

#import "LocalEcho.h"

@implementation LocalEcho
+ (void)LocalSave:(NSString *)FileName type:(id)type
{
    NSString *path =  NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
    NSString *Name = [NSString stringWithFormat:@"/%@.plist", FileName];
    NSString *dataPath = [path stringByAppendingString:Name];
    [type writeToFile:dataPath atomically:YES];
}
+ (NSMutableArray *)GetFile:(NSString *)Cache
{
    NSString *path =  NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
    NSString *Name = [NSString stringWithFormat:@"/%@.plist", Cache];
    NSString *dataPath = [path stringByAppendingString:Name];
    NSMutableArray *result = [NSMutableArray arrayWithContentsOfFile:dataPath];
    return result;
}
+ (NSMutableDictionary *)GetCache:(NSString *)Cache
{
    NSString *path =  NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
    NSString *Name = [NSString stringWithFormat:@"/%@.plist", Cache];
    NSString *dataPath = [path stringByAppendingString:Name];
    NSMutableDictionary *result = [NSMutableDictionary dictionaryWithContentsOfFile:dataPath];
    return result;
}
@end
